<!DOCTYPE html>
<title>CSS Lists: counters updated when element with counter operation on its pseudo element is removed</title>
<link rel="help" href="https://drafts.csswg.org/css-lists/#inheriting-counters">
<link rel="match" href="pseudo-element-remove-update-ref.html">
<style>
body {
  counter-reset: myCounter;
}
div::before {
  content: counter(myCounter);
  counter-increment: myCounter;
}
</style>
<body>
<div>test</div>
<div id="target">test</div>
<div>test</div>
<script>
  document.documentElement.offsetTop;
  target.remove();
</script>
</body>
